package com.gxkj.qiao.daos;

import com.gxkj.common.hibernate.HibernateBaseRepositoryImpl;
import com.gxkj.qiao.entitys.Movie;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;

@Repository
public class MovieDaoImpl extends HibernateBaseRepositoryImpl {
    public Movie getMovieByDirectAndTile(String movieDirect, String movieTitle){
        String hql = "from Movie where movieTitle = :movieTitle and movieDirect=:movieDirect order by updatedAt";
        Map<String,Object> data = new HashMap<>();

        data.put("movieDirect",movieDirect);
        data.put("movieTitle","movieTitle");

        Movie dbmovie = this.selectLastOneByHQL(hql,data);
        return dbmovie;

    }
}
